package com.itheim.neibulei;
/*
普通的 成员内部类
 */
public class Test {
    public static void main(String[] args) {
        Outer outer = new Outer();
        System.out.println(outer.i);
        outer.sing();
        // 创建内部类对象的格式
        //类名  对象 = new 类名()
      Outer.Inner inner = outer.new Inner();
      Outer.Inner inner2= new Outer().new Inner();
        System.out.println(inner.j);
        inner.dance();
    }

}

class Outer {
    int i = 10;

    public void sing() {
        System.out.println("只因你太美");
    }

    //成员内部类
    class Inner {
        int j = 10;

        public void dance() {
            System.out.println("蹦跶");
        }
    }
}

